package com.cf.oss.core;

/**
 * game-server-UploadFileRequestBuilder
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/6/5 下午 12:02
 */

import com.aliyun.oss.model.Callback;
import com.aliyun.oss.model.ObjectMetadata;
import com.aliyun.oss.model.UploadFileRequest;

public class UploadFileRequestBuilder {
    private UploadFileRequest uploadFileRequest;

    public UploadFileRequestBuilder(String bucketName, String key) {
        this.uploadFileRequest = new UploadFileRequest(bucketName, key);
    }

    public UploadFileRequestBuilder bucketName(String bucketName) {
        this.uploadFileRequest.setBucketName(bucketName);
        return this;
    }

    public UploadFileRequestBuilder key(String key) {
        this.uploadFileRequest.setKey(key);
        return this;
    }

    public UploadFileRequestBuilder taskNum(int taskNum) {
        this.uploadFileRequest.setTaskNum(taskNum);
        return this;
    }

    public UploadFileRequestBuilder uploadFile(String uploadFile) {
        this.uploadFileRequest.setUploadFile(uploadFile);
        return this;
    }

    public UploadFileRequestBuilder enableCheckpoint(boolean enableCheckpoint) {
        this.uploadFileRequest.setEnableCheckpoint(enableCheckpoint);
        return this;
    }

    public UploadFileRequestBuilder checkpointFile(String checkpointFile) {
        this.uploadFileRequest.setCheckpointFile(checkpointFile);
        return this;
    }

    public UploadFileRequestBuilder objectMetadata(ObjectMetadata objectMetadata) {
        this.uploadFileRequest.setObjectMetadata(objectMetadata);
        return this;
    }

    public UploadFileRequestBuilder callback(Callback callback) {
        this.uploadFileRequest.setCallback(callback);
        return this;
    }

    public UploadFileRequest build() {
        return this.uploadFileRequest;
    }
}
